package com.zjk.dict.controller;

import com.zjk.dict.service.DictService;
import com.zjk.pojo.product.TbDict;
import com.zjk.result.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: gfk
 * @create: 2022/11/2
 * @Description:
 * @FileName: DictCotnroller
 * @History:
 * @自定义内容：
 */

@RestController
@RequestMapping("/dict")
public class DictCotnroller {
    @Autowired
    private DictService dictService;

    @GetMapping("/prodctTypeList")
    public List<TbDict> getProductTypeList(){
        return dictService.getProductTypeList();
    }

    @GetMapping("/prodctTypeByValue/{value}")
    public TbDict getProductTypeValue(@PathVariable String value){
        return dictService.getProductTypeValue(value);
    }

     @GetMapping("/RepaymentWayList")
    public List<TbDict> getRepaymentWayList(){
        return dictService.getRepaymentWayList();
    }

    @PostMapping("/saveProductType")
    public ResultResponse saveProductType(@RequestBody TbDict tbDict){
        return dictService.saveProductType(tbDict);
    }

    @GetMapping("/RepaymentWayByValue/{value}")
    public TbDict RepaymentWayByValue(@PathVariable String value){
        return dictService.RepaymentWayByValue(value);
    }
}
